refactor(gh-cli): split SKILL.md into progressive-disclosure reference files 🤖🤖🤖#1688
Closed
sokratisg wants to merge 2 commits into
Closed
refactor(gh-cli): split SKILL.md into progressive-disclosure reference files 🤖🤖🤖#1688sokratisg wants to merge 2 commits into
sokratisg wants to merge 2 commits into
Conversation
…e files
Break the 2,187-line / 6,137-word monolithic SKILL.md into a short
router (~60 lines) plus 11 focused reference/*.md files, each covering
one command group. The router tells Claude which file to read based on
the task; specific references are loaded only when needed.
Motivation: the previous single-file layout loaded ~6k words into
context every time the skill activated, even for a task that only
needs `gh pr merge` or `gh api`. Splitting reduces the up-front load
to ~530 words (~91% smaller) while preserving every command group
from the original.
Layout:
SKILL.md router + index
reference/auth.md install, login, tokens, env
reference/repo.md gh repo
reference/issue.md gh issue
reference/pr.md gh pr
reference/actions.md run / workflow / cache / secret / variable
reference/api.md REST, GraphQL, pagination, jq
reference/projects.md Projects v2
reference/release.md releases + assets
reference/formatting.md --json / --jq / --template
reference/workflows.md end-to-end recipes
reference/misc.md browse, gist, codespace, org, search,
label, ssh-key, gpg-key, status, config,
extension, alias, ruleset, attestation,
completion, preview, agent-task
Also corrects a few command signatures along the way:
- gh repo autolink create (was: add)
- gh attestation verify arguments
- gh api -f / -F field-type semantics
Validated with \`npm run skill:validate\` and \`npm run build\`.
Contributor
🔍 Skill Validator Results✅ All checks passed
Summary
Full validator output```text Found 1 skill(s) [gh-cli] 📊 gh-cli: 1,284 BPE tokens [chars/4: 1,228] (detailed ✓), 11 sections, 2 code blocks ✅ All checks passed (1 skill(s)) ``` |
Skill validator warned "No code blocks — agents perform better with concrete snippets and commands." Added a Quick start section with install, auth, and everyday-command snippets (each pointing to the relevant reference/*.md), plus the GH_TOKEN / GH_PROMPT_DISABLED scripting pattern. Validator warning resolved.
aaronpowell
reviewed
May 13, 2026
Contributor
aaronpowell
left a comment
There was a problem hiding this comment.
In the 1.0.46 release of Copilot CLI we have introduced some checks to support auto-approval of read-only gh commands (see the release notes).
Looking more into it, it seems that the models have a pretty solid handle on the gh CLI already, without the need for a skill or anything. Here's a quick test I did:
❯ Do not make any external tool calls (no shell commands, no web search, no skills, etc.)
How would I get the pull requests from a github repo using the github cli
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
● Use:
gh pr list --repo OWNER/REPO
Common options:
gh pr list --repo OWNER/REPO --state all
gh pr list --repo OWNER/REPO --limit 100
gh pr list --repo OWNER/REPO --json number,title,state,url
gh pr view 123 --repo OWNER/REPO
Examples:
- List open PRs: gh pr list --repo cli/cli
- List all PRs: gh pr list --repo cli/cli --state all
- Get JSON output: gh pr list --repo cli/cli --json number,title,author,state,url
Or via the API:
gh api repos/OWNER/REPO/pulls
Authenticate first if needed:
gh auth login
As a result, it seems logical to remove the skill from the repo entirely - it now falls into the category of "Duplicate Existing Model Strengths Without Meaningful Uplift".
This isn't a critique on the change you proposed - it would be a valuable change, if it wasn't to something that is no longer required in the repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures the
gh-cliskill to use progressive disclosure: a short routerSKILL.md+ 11 focusedreference/*.mdfiles, each scoped to one command group. The router tells the agent which reference file to open based on the task; individual references are loaded only when needed.Motivation
The current
skills/gh-cli/SKILL.mdis a single file — 2,187 lines / 6,137 words / ~40KB — that loads in full whenever the skill activates, even for a task that only needsgh pr mergeorgh api. For a reference-style skill covering 20+ command groups, this is a large context tax on every activation.Splitting reduces the up-front load when the skill fires to ~60 lines / 530 words (~91% smaller) while preserving every command group from the original.
Layout
Why progressive disclosure
Anthropic's skill authoring guidance (agentskills.io) recommends keeping
SKILL.mdsmall and offloading heavy reference material to separate files that the agent reads on demand. For reference skills that span many subcommands, this keeps the "when to use + routing" signal high and the per-activation token cost low.Minor corrections folded in
While restructuring I corrected a few command signatures that were wrong in the original:
gh repo autolink create(was documented asadd)gh attestation verifyargument formatgh api -f/-Ffield-type semantics (string coercion vs. raw)Validation
npm run skill:validate— all 341 skills valid ✅npm run build— regeneratesdocs/README.skills.md(the description column now reflects the new "Use when…" phrasing, and the Assets column showsreference) ✅Description field change
The
description:in frontmatter changes from:to:
The new phrasing starts with "Use when…" (matching Anthropic's CSO guidance for skill descriptions), and the coverage list is equivalent.
Test plan
npm run skill:validatepassesnpm run buildproduces only expected diffs (one row indocs/README.skills.mdforgh-cli)reference/*.mdfiles render correctly on GitHubreference/<file>.md)reference/actions.md)